import React from "react";

/* Bad */
/* let guest = 0;
function Cup() {
  guest = guest + 1;
  return <h2>Tea cup for guest #{guest}</h2>;
} */

/* Good */
interface CupProps {
  guest: number;
}
function Cup({ guest }: CupProps) {
  return <h2>Tea cup for guest #{guest}</h2>;
}

function TeaCup() {
  console.log(React.version);
  return (
    <>
      <Cup guest={1} />
      <Cup guest={2} />
      <Cup guest={3} />
    </>
  );
}

export default TeaCup;
